package com.mayikt.mapper;

import com.mayikt.entity.OrderEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface OrderMapper {

    @Insert("INSERT INTO `t_order` VALUES (${orderId},#{userId});")
    int addOrder(String orderId, Long userId);


    @Select("SELECT order_id as orderId  FROM t_order limit  0,5; ")
    List<String> findListOrders();

    @Select("SELECT order_id as orderId,user_id as userId  FROM t_order  where order_id=#{orderId} ")
    OrderEntity findByOrderId(@Param("orderId") Long orderId);
}
